<!-- mate start -->
<?php $this->load->view('assists/mate.php') ?>
<!-- mate end -->
<link rel="stylesheet" href="<?=base_url('static/index/css/project_join_detail.css')?>">
<title>报名参加情况</title>
<!-- header strat -->
<?php $this->load->view('assists/header.php') ?>
<!-- header end -->
	<div id="top-alert" class="fixed alert-success" style="display:none;">
    	<button class="close fixed" >×</button>
    	<p class="alert-content">这是内容</p>
    </div>
    
	<div id="project_message">
		<div class="project_message clearfix">
			<div class="project_title">
				<h2><?=$project['title']?></h2>
				<p><span>发起人</span> <a href="#"><?=$project['username']?></a></p>
			</div>
			<div class="xqDetailBox">
				<div class="xqDetailLeft">
					<img src="<?=base_url($project['logo'])?>" />
				</div>
				<div class="xqDetailRight">
					<div class="xqDetailData">人数限额：<span><?=$project['personNum']?>人</span></div>
					<div class="xqDetailData">参加人数：<span><?=$project_participater_count?>人</span></div>
					<div class="xqDetailData">剩余天数：<span><?=$project['time_different']?>天</span></div>
					<div class="xqDetailBtnBox">
						<a href="<?=site_url('Project_participater/join_project/'.$project['pid'])?>" class="xqDetail_supA ajax-get">立即支持</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="participater_message">
		<div class="participater_message">
			<div class="participater_box">
				<ul class="participater_boxUl clearfix">
					<li class="active">项目内容</li>
					<li>支持记录</li>
				</ul>
				<div class="tab_con">
					<div class="tab_list" id="project_content_list">
						<div class="project_content_list">
				        	<ul class="project_content_list_ul">
				        		<?php foreach ($project_content_list as $key => $row): ?>
				            	<li class="clearfix" id="F<?=($key+1)?>" name="F<?=($key+1)?>">
				                	<div class="project_content_list_ul_left">
				                    	<p>
				                    	<?php if($row['type']==0){ ?>
				                        	<!--作为这个世界上最流行的编程语言之一的合作设计者，我经常遇到一种令人非常沮丧的行为( Python 社区和其它领域中都存在)就是社区中有影响力的人尝试去在其它开源社区中灌输对于”缺失“的恐惧感，并以此驱动别人对本社区做出贡献（我自己偶尔也会做出这样不当的行为，当别人掉进这个陷阱时我也更容易觉察出来）。-->
				                        	<?=$row['content']?>
				                        <?php }else{?>
				                        	<img src="<?=base_url($row['content'])?>">
				                        <?php } ?>
				                        </p>
				                        
				                    </div>
				                    <div class="project_content_list_ul_right">
				                    	<?php if(!empty($row['comment'])){ ?>
				                    	<ul class="project_content_user_ul">
				                    		<?php foreach ($row['comment'] as $value): ?>
				                        	<li class="clearfix">
				                            	<div class="project_content_user_logo">
				                                	<a href="
				                                	<?php if($value['user_id']==$this->session->userdata('uid')){
				                                		echo site_url('User_center');
				                                	}else{
				                                		echo site_url('User_info/index/'.$value['user_id']);
				                                	} ?>
				                                	">
				                                		<img src="<?=base_url(ltrim($value['user_logo'],"."))?>" />
				                                	</a>
				                                </div>
				                                <div class="project_content_user_content">
				                                    　　				<p><?=$value['content']?></p>
				                                </div>
				                            </li>
				                            <?php endforeach; ?>
				                        </ul>
				                        <?php } ?>
				                        <div class="project_content_list_ul_left_content clearfix">
				                        	<a href="<?=site_url('Project_content_comment/add/'.$row['pcid'])?>" class="project_content_comment">评论</a>
				                        	<?php if(!empty($row['comment'])){ ?>
				                        	<a href="<?=site_url('Project_content/project_content_detail/'.$row['pcid'])?>" target="_blank" class="more_a">更多</a>
				                        	<?php } ?>
				                        </div>
				                    </div>
				                    <div class="tool">
				                    	<ul class="clearfix">
				                        	<li><a href="<?=site_url('Project_content/up_sort/'.$row['pcid']."/".$row['sort'])?>" class="ajax-get"><i class="up"></i></a></li>
				                            <li><a href="<?=site_url('Project_content/down_sort/'.$row['pcid'])."/".$row['sort']?>" class="ajax-get"><i class="down"></i></a></li>
				                        </ul>
				                    </div>
				                </li>
				                <?php endforeach; ?>
				            </ul>
				        </div>
			       		<div id="project_content_text_box">
				        </div>
				        <div id="project_content_img_box">
				        	<div class="project_content_img_box">
				            	<div class="img-con-tit clearfix">
				            		<div class="img-con-tit-left"><span class="fz16">添加图片</span></div>
				            		<div class="img-con-tit-right"><input type="button" value="删除" class="img_del_btn" onclick="delete_img(this)"></div>
				            	</div>
				            	<div class="img_content">
						            <div id="altContent">
										<h1>美图秀秀</h1>
									</div>
								</div>
							</div>
				        </div>
				        <?php if(isset($_SESSION['username'])&&($project['username']==$this->session->userdata('username'))){ ?>
				        <div class="add_project_content">
				            <div class="add_project_content_type clearfix">
				            	<div class="add_project_content_text" onclick="addBlock('text')">
				                	<i class="add_text"></i>添加文本
				                </div>
				                <div class="add_project_content_img" onclick="addBlock('img')">
				                	<i class="add_img"></i>添加图片
				                </div>
				            </div>
				        </div>
				        <?php } ?>
					</div>
					
			        <div class="tab_list" style="display:none;">
						<table class="table">
							<thead><tr><th>用户</th><th>是否为发起人</th><th>时间</th></tr></thead>
							<tbody>
								<?php foreach ($project_participater_list as $row): ?>
								<tr>
									<td>
										<?php if($row['username'] == $this->session->userdata('username')){ ?>
											<a href="<?=site_url('User_center')?>"><?=$row['username']?></a>
										<?php }else{ ?>
											<a href="<?=site_url('User_info/index/'.$row['uid'])?>"><?=$row['username']?></a>
										<?php } ?>
									</td>
									<td>
										<?php if($row['isparticipater']){
											echo "是";
										}else{
											echo "否";
										} ?>
									</td>
									<td><?=date("Y-m-d",$row['createtime'])?></td>
								</tr>
								<?php endforeach; ?>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="ECode-floatBar">
		<ul class="ECode-floatBar-Ul">
			<?php foreach ($project_content_list as $key => $row): ?>
			<li><a href="#F<?=($key+1)?>">F<?=($key+1)?></a></li>
			<?php endforeach; ?>
		</ul>
	</div>
	<!-- footer start -->
   	<?php $this->load->view('assists/footer.php') ?>
   	<!-- footer end -->
   	<script type="text/javascript" src="<?=base_url('static/index/js/ajax.js')?>"></script>
   	<script type="text/javascript" src="<?=base_url('static/index/js/project_join_detail.js')?>"></script>
    <script src="http://open.web.meitu.com/sources/xiuxiu.js" type="text/javascript"></script>
	<script type="text/javascript">
	window.onload=function(){
	       /*第1个参数是加载编辑器div容器，第2个参数是编辑器类型，第3个参数是div容器宽，第4个参数是div容器高*/
		xiuxiu.embedSWF("altContent",2,"100%","100%");
	       //修改为您自己的图片上传接口
		xiuxiu.setUploadURL("<?=site_url('Project_content/uploadImage/'.$project['pid'])?>");
	        xiuxiu.setUploadType(2);
	        xiuxiu.setUploadDataFieldName("Filedata");
		xiuxiu.onInit = function ()
		{
			xiuxiu.loadPhoto("http://open.web.meitu.com/sources/images/1.jpg");
		}	
		xiuxiu.onUploadResponse = function (data)
		{
			//alert("上传响应" + data);  可以开启调试
			//alert(data);
			//console.log(data);
			//alert("nihao");
			location.reload();
		}
	}
	function addBlock(category){
		var content_box_object = $("#project_content_text_box");
		if(category=="text"){
			var string ='<div class="project_content_text_box"><form action="<?=site_url('Project_content/addText')?>" method="post"><input type="hidden" name="pid" value="<?=$project['pid']?>" /><div class="text-con-tit clearfix"><div class="text-con-tit-left"><span class="fz16">添加文本</span></div><div class="text-con-tit-right"><input type="button" value="删除" onclick="delete_content(this)" class="del_btn"><input type="submit" class="text-con-tit-right-btn textSave" value="保存" /></div></div><div class="text-con-con"><textarea name="content" class="text-con-con-box" placeholder="请输入正文"></textarea></div></form></div>';
			content_box_object.append(string);
		}else if(category=="img"){
			//var string ='<div class="project_content_img_box"><div class="img-con-tit clearfix"><div class="img-con-tit-left"><span class="fz16">添加文本</span></div><div class="img-con-tit-right"><input type="button" value="删除" class="img_del_btn"></div></div><div class="img_content"><div id="altContent"><h1>美图秀秀</h1></div></div></div>';
			//content_box_object.append(string);
			$(".project_content_img_box").css("display","block");
		}
	}
	</script>
</body>
</html>